package ControlLayer;
import java.util.ArrayList;
import ModelLayer.*;
/**
 * Controller class for the DVD collection
 * 
 * @author (kbh) 
 * @version (2005.03.31)
 * @revised version English (Ab)
 * (FEN): 2006.03.21: Some changes to the architecture in order to assure layering
 *                    and loose coupling
 */
public class DVDCtr
{
    private DVDList dvd;
    private Copy copy; 

    public DVDCtr()
    {
        dvd=new DVDList();   

    }
    
  
    public DVD findDVD(int no)
    {
     return dvd.findDVD(no);
  
    }
    
   
    public void createDVD(int id,String title,String artist,String publicationDate)
    {  DVD d=new DVD(id,title,artist,publicationDate);
       dvd.addDVD(d);
    }
    
    public void deleteDVD(int no)
    {
      dvd.removeDVD(no);  
       
    }
    
    public void createCopy(int no,int id,String purchaseDate,String purchasePrice)
    {Copy c=new Copy(id,purchaseDate,purchasePrice);  
     dvd.findDVD(no).addCopy(c);
    }
    
    
    public ArrayList listAllDvds()
    { return dvd.getList();
    }
}
